<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue - slot</title>
</head>
<body>
<div id="app">
    <btn>
        <template #head="text"><h1>111---{{text.data}}</h1></template>
        <template #content><h3>222</h3></template>
        <template #foot><h2>333</h2></template>
    </btn>
</div>
<template id="btn">
    <div>
        <button>按钮</button>
        <slot name="head" :data="text"></slot>
        <slot name="content"></slot>
        <slot name="foot"></slot>
    </div>
</template>
<script src="../vue.js"></script>
<script>
    var btn = {
        template: '#btn',
        data() {
            return{
                text:'收到对方',
            }
        }
    };

    new Vue({
        el:'#app',
        data(){
            return{}
        },
        components:{
            btn,
        }
    })
</script>
</body>
</html>